﻿/* Write a program that parses an URL address given in the format:
[protocol]://[server]/[resource]
and extracts from it the [protocol], [server] and [resource] elements. For example from the
URL http://www.devbg.org/forum/index.php the following information should be extracted:
[protocol] = "http";
[server] = "www.devbg.org";
[resource] = "/forum/index.php";
 */
using System;

namespace _12.ParseURL
{
    class ParseURL
    {
        static void Main()
        {
            Console.Write("Enter url to parse: ");
            string url = Console.ReadLine();
            
            //string url = "http://www.devbg.org/forum/index.php";
            Uri parsed = new Uri(url);
            Console.WriteLine("Protocol: {0}\r\nserver: {1}\r\nresource: {2}", parsed.Scheme, parsed.Host, parsed.AbsolutePath);
        }
    }
}
